Skip to content

Fix issue 20073 with diff suppress#17283

Open
faustroxas wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
faustroxas:fix/issue_20073_followup
Open

Fix issue 20073 with diff suppress#17283
faustroxas wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
faustroxas:fix/issue_20073_followup

Conversation

@faustroxas
Copy link
Copy Markdown
Contributor

Fixes Issue #20073

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

google_tags_tag_key: remove ignore_read: true from purposeData & add diff suppress to fix issue #20073

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Apr 24, 2026
@github-actions
Copy link
Copy Markdown

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@roaks3, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@github-actions github-actions Bot requested a review from roaks3 April 24, 2026 06:35
// actual organization number. Since purpose_data is immutable, if the old value
// (from state) exists and is non-empty, we suppress the diff to avoid
// unnecessary replacements after import.
func TagKeyPurposeDataDiffSuppress(k, old, new string, d *schema.ResourceData) bool {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm understanding correctly, wouldn't this also prevent someone from changing purpose_data in their config (and getting a plan to replace the tag key)?

Copy link
Copy Markdown
Contributor Author

@faustroxas faustroxas Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes that would be the case and you're right to catch it. That is not what I want to do. Do you have any recommendations on how to get around the issue?
hashicorp/terraform-provider-google#20073

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roaks3 for more context, we are trying to import these secure tag keys. However, since purpose_data is not imported by provider, terraform is forcing replacements of the tag keys which we do not want as they are in use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-approval Pull requests that need reviewer's approval to run presubmit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants